package com.xdh.springcloud.data.repository;

import com.xdh.springcloud.data.bean.TestUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface UserRepository extends JpaRepository<TestUser, Long> {

    TestUser findByName(String name);

    @Query("from TestUser u where u.name=:name")
    TestUser findUser(@Param("name") String name);

}